<?php
namespace app\cms\controllers;
use app\cms\common\ViewBaseController;
use app\cms\models\ArticleClassModel;
use app\cms\models\ArticleModel;

class MyController extends ViewBaseController {

    public function actionIndex(){
        //首页获取推荐文章和全部分类
        list($ArticleModel,$ArticleClassModel)= [new ArticleModel(),new ArticleClassModel()];
        $data['data']['article'] = $ArticleModel->getArticleByHot([['=','@article.is_del',0]],'click_number DESC,add_time DESC');
        $data['data']['class'] = $ArticleClassModel->getArticleClass();
        $data['title']='my-item-cms-首页';
        $this->assign('data',$data);
        return $this->display('my/index');
    }
}